package com.dragon8869.myspringboot.service;

import com.dragon8869.myspringboot.entity.AyUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Collection;
import java.util.List;
import java.util.concurrent.Future;

public interface AyUserService {
    AyUser findById(Integer id);
    List<AyUser> findAll();
    AyUser save(AyUser ayUser);
    void delete(Integer id);

    //分页
    Page<AyUser> findAll(Pageable pageable);

    //自定义查询
    AyUser findByName(String name);
    List<AyUser> findByNameLike(String name);
    List<AyUser> findByIdIn(Collection<Integer> ids);


    //mapper dao
    AyUser findByNameAndPassword(String name, String password);
    AyUser createUser(AyUser ayUser);
    AyUser updateUser(AyUser ayUser);
    AyUser deleteUser(Integer id);


    Future<List<AyUser>> findAsynAll();
}
